
import React from 'react';
import Footer from 'views/footer/footer';
import Header from 'views/header/header';

const Init = React.createClass({
    render() {
        let pathName = this.props.location.pathname, footerNode;
        if (pathName.indexOf('/') > -1) {
            pathName = pathName.split('/')[1];
        }
        let footerShoWPattern = /(flowSummary)|(brand)|(floors)|(retailPatterns)\/*/i;
        if (footerShoWPattern.test(pathName)) {
            footerNode = <Footer pathName={pathName} shopId={this.props.params.shopId}/>;
        }
        return (
            <div id="main" className="flex d-column">
                <Header pathName={pathName} />
                <div id="content" className="flex-g-1">
                    {this.props.children}
                </div>
                {footerNode}
            </div>
        );
    }
})

module.exports = Init;